<template>
    <div>
        <h6>Child1</h6>
        {{msg}}
        <button @click="$emit('back','这就回家吃饭')">回复父组件 </button>
    </div>
</template>

<script>
export default {
  props: {
    msg: {
      type: String
    }
  },
  mounted() {
    // this.$bus.$on("event-from-child2", msg => {
    //   console.log("Child1", msg);
    // });
    this.$parent.$on("event-from-child2", msg => {
      console.log(msg);
    });
  },
  methods: {
    eat() {
      console.log("我这就回家吃饭");
    }
  }
};
</script>

<style lang="scss" scoped>
</style>